<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>SmartphoneBrainScanner2: JAMA::Cholesky&lt; Real &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="sbs2_icon.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">SmartphoneBrainScanner2
   </div>
   <div id="projectbrief">A framework for building cross-platform real-time EEG applications. http://code.google.com/p/smartphonebrainscanner2/</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_j_a_m_a_1_1_cholesky.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">JAMA::Cholesky&lt; Real &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="jama__cholesky_8h_source.html">jama_cholesky.h</a>&gt;</code></p>

<p><a href="class_j_a_m_a_1_1_cholesky-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a0af68661b83b7a6be938b42e2b2591b6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_cholesky.html#a0af68661b83b7a6be938b42e2b2591b6">Cholesky</a> ()</td></tr>
<tr class="memitem:af859c41220c4313470d28fa13706ff63"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_cholesky.html#af859c41220c4313470d28fa13706ff63">Cholesky</a> (const <a class="el" href="class_t_n_t_1_1_array2_d.html">Array2D</a>&lt; Real &gt; &amp;A)</td></tr>
<tr class="memitem:a274b8bbd584bcf84ec860a24aa2b8b2a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_t_n_t_1_1_array2_d.html">Array2D</a>&lt; Real &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_cholesky.html#a274b8bbd584bcf84ec860a24aa2b8b2a">getL</a> () const </td></tr>
<tr class="memitem:af0f727e2b0e989f7606cdb49de69f119"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_t_n_t_1_1_array1_d.html">Array1D</a>&lt; Real &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_cholesky.html#af0f727e2b0e989f7606cdb49de69f119">solve</a> (const <a class="el" href="class_t_n_t_1_1_array1_d.html">Array1D</a>&lt; Real &gt; &amp;B)</td></tr>
<tr class="memitem:a8a3c0067663955146713a9aa3b8a3413"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_t_n_t_1_1_array2_d.html">Array2D</a>&lt; Real &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_cholesky.html#a8a3c0067663955146713a9aa3b8a3413">solve</a> (const <a class="el" href="class_t_n_t_1_1_array2_d.html">Array2D</a>&lt; Real &gt; &amp;B)</td></tr>
<tr class="memitem:ab8ac7d6f0c9ef4e0fb74b001fe03ff90"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_cholesky.html#ab8ac7d6f0c9ef4e0fb74b001fe03ff90">is_spd</a> () const </td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;class Real&gt;<br/>
class JAMA::Cholesky&lt; Real &gt;</h3>

<p>For a symmetric, positive definite matrix A, this function computes the <a class="el" href="class_j_a_m_a_1_1_cholesky.html">Cholesky</a> factorization, i.e. it computes a lower triangular matrix L such that A = L*L'. If the matrix is not symmetric or positive definite, the function computes only a partial decomposition. This can be tested with the <a class="el" href="class_j_a_m_a_1_1_cholesky.html#ab8ac7d6f0c9ef4e0fb74b001fe03ff90">is_spd()</a> flag.</p>
<p>Typical usage looks like: </p>
<pre>
        <a class="el" href="class_t_n_t_1_1_array2_d.html">Array2D&lt;double&gt;</a> A(n,n);
        <a class="el" href="class_t_n_t_1_1_array2_d.html">Array2D&lt;double&gt;</a> L;</pre><pre>         ...</pre><pre>        Cholesky&lt;double&gt; chol(A);</pre><pre>        if (chol.is_spd())
                L = chol.getL();</pre><pre>        else
                cout &lt;&lt; "factorization was not complete.\n";</pre><pre>        </pre><p>(Adapted from <a class="el" href="namespace_j_a_m_a.html">JAMA</a>, a Java Matrix Library, developed by jointly by the Mathworks and NIST; see <a href="http://math.nist.gov/javanumerics/jama">http://math.nist.gov/javanumerics/jama</a>). </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a0af68661b83b7a6be938b42e2b2591b6"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_j_a_m_a_1_1_cholesky.html">JAMA::Cholesky</a>&lt; Real &gt;::<a class="el" href="class_j_a_m_a_1_1_cholesky.html">Cholesky</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="af859c41220c4313470d28fa13706ff63"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_j_a_m_a_1_1_cholesky.html">JAMA::Cholesky</a>&lt; Real &gt;::<a class="el" href="class_j_a_m_a_1_1_cholesky.html">Cholesky</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_t_n_t_1_1_array2_d.html">Array2D</a>&lt; Real &gt; &amp;&#160;</td>
          <td class="paramname"><em>A</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Constructs a lower triangular matrix L, such that L*L'= A. If A is not symmetric positive-definite (SPD), only a partial factorization is performed. If <a class="el" href="class_j_a_m_a_1_1_cholesky.html#ab8ac7d6f0c9ef4e0fb74b001fe03ff90">is_spd()</a> evalutate true (1) then the factorizaiton was successful. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a274b8bbd584bcf84ec860a24aa2b8b2a"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_n_t_1_1_array2_d.html">Array2D</a>&lt; Real &gt; <a class="el" href="class_j_a_m_a_1_1_cholesky.html">JAMA::Cholesky</a>&lt; Real &gt;::getL </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns:</dt><dd>the lower triangular factor, L, such that L*L'=A. </dd></dl>

</div>
</div>
<a class="anchor" id="ab8ac7d6f0c9ef4e0fb74b001fe03ff90"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_j_a_m_a_1_1_cholesky.html">JAMA::Cholesky</a>&lt; Real &gt;::is_spd </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns:</dt><dd>1, if original matrix to be factored was symmetric positive-definite (SPD). </dd></dl>

</div>
</div>
<a class="anchor" id="af0f727e2b0e989f7606cdb49de69f119"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_n_t_1_1_array1_d.html">Array1D</a>&lt; Real &gt; <a class="el" href="class_j_a_m_a_1_1_cholesky.html">JAMA::Cholesky</a>&lt; Real &gt;::solve </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_t_n_t_1_1_array1_d.html">Array1D</a>&lt; Real &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<pre class="fragment"> Solve a linear system A*x = b, using the previously computed
 cholesky factorization of A: L*L'.
</pre><dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">B</td><td>A Matrix with as many rows as A and any number of columns. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>x so that L*L'*x = b. If b is nonconformat, or if A was not symmetric posidtive definite, a null (0x0) array is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="a8a3c0067663955146713a9aa3b8a3413"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_n_t_1_1_array2_d.html">Array2D</a>&lt; Real &gt; <a class="el" href="class_j_a_m_a_1_1_cholesky.html">JAMA::Cholesky</a>&lt; Real &gt;::solve </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_t_n_t_1_1_array2_d.html">Array2D</a>&lt; Real &gt; &amp;&#160;</td>
          <td class="paramname"><em>B</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<pre class="fragment"> Solve a linear system A*X = B, using the previously computed
 cholesky factorization of A: L*L'.
</pre><dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">B</td><td>A Matrix with as many rows as A and any number of columns. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>X so that L*L'*X = B. If B is nonconformat, or if A was not symmetric posidtive definite, a null (0x0) array is returned. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_j_a_m_a.html">JAMA</a></li><li class="navelem"><a class="el" href="class_j_a_m_a_1_1_cholesky.html">Cholesky</a></li>
    <li class="footer">Generated on Fri Jun 29 2012 14:30:34 for SmartphoneBrainScanner2 by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.1 </li>
  </ul>
</div>
</body>
</html>
